<br>
<table align="center" cellspacing="2" cellpadding="2" border="0">
<tr>
    <td colspan="2" align="center">
	<h1>Gamma distributed random effects</h1>
		<br><br>
	</td>
</tr>

<tr>
    <td width="30%">
	<table width="90%" border="0" cellspacing="0" cellpadding="2" bgcolor="#359163">
         <tr>
           <td align="center">
             <font face="Arial, Helvetica" color="White"><b>ADMB Files</b></font>
           </td>
         </tr>
         <tr>
           <td>
             <table cellspacing=0 cellpadding=3 width="100%" border=0 bgcolor="#ffffff">
               <tr>
			     <td>
                     Code: <a href="liver_gamma.tpl">liver_gamma.tpl</a><br>
                     Data: 		<a href="liver_gamma.dat">liver_gamma.dat</a><br>
                     Initial values: <a href="liver_gamma.pin">liver_gamma.pin</a><br>
<!--
                     All required files (DOS): <a href="liver_gamma.zip">liver_gamma.zip</a><br>
					 All required files (linux): <a href="liver_gamma.tar.gz">liver_gamma.tar.gz</a><br>					 
-->
                     Expected Results: <a href="liver_gamma-expected-results.par">liver_gamma-expected-results.par</a><br>
				   </font>
                 </td>
               </tr>
             </table>
           </td>
         </tr>
       </table>
<!--
<br>

	<table width="90%" border="0" cellspacing="0" cellpadding="2" bgcolor="#359163">
         <tr>
           <td align="center">
             <font face="Arial, Helvetica" color="White"><b>SAS code from Nelson et al.</b></font>
           </td>
         </tr>
         <tr>
           <td>
             <table cellspacing=0 cellpadding=3 width="100%" border=0 bgcolor="#ffffff">
               <tr>
			     <td>
                     SAS code: <a href="liver_gamma.sas">liver_gamma.sas</a><br>
				   </font>
                 </td>
               </tr>
             </table>
           </td>
         </tr>
       </table>
<br>

	<table width="90%" border="0" cellspacing="0" cellpadding="2" bgcolor="#359163">
         <tr>
           <td align="center">
             <font face="Arial, Helvetica" color="White"><b>Running ADMB-executables</b></font>
           </td>
         </tr>
         <tr>
           <td>
             <table cellspacing=0 cellpadding=3 width="100%" border=0 bgcolor="#ffffff">
               <tr>
			     <td>
                     In a <a href="../admb_tutorial.html">DOS</a> window<br> 
					 Under <a href="../admb_tutorial.html">linux</a><br>
				   </font>
                 </td>
               </tr>
             </table>
           </td>
         </tr>
       </table>
<br>


	   
	   <br>
	   
	      <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0>
        <TR>
          <TD align=middle><FONT face="Arial, Helvetica" 
            color=white><B>Navigation</B></FONT> </TD></TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff 
            border=0>
              <TBODY>
              <TR>
                <TD>			  
				<A href="http://otter-rsch.com/admbre/admbre.html">ADMB-RE home</A> <br>
                <A href="http://otter-rsch.com/">Otter Research</A> 
        </FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR>
      <TABLE cellSpacing=0 cellPadding=2 width="90%" bgColor=#359163 border=0></TABLE>

-->
	   
	</td>

	
 <td width="75%">
<h3><strong>Model description</strong></h3>

It is customary to use normally distributed random effects, but in some situations other distributions
than the normal are required. We shall here illustrate the use of gamma distributed random effects in ADMB-RE. <br>
<br>
The problem with non-Gaussian random effects is that the Laplace approximation underlying ADMB-RE may
be inaccurate. To avoid this we start out with N(0,1) distributed random variables (r.v.), which
are transformed into gamma distributed r.v., via the inverse cumulative distribution function
for the gamma distribution. The steps are:
<br>
<br>
u ~ N(0,1) is the underlying random effect.<br>
z = F(u), is uniformly distributed, where F() is  cumulative distribution function of u.<br>
g = G_inv(z), where G_inv() is the inverse cumulative distribution function of the target gamma distribution.<br>
<br>
As a result, g will be a variable, with a gamma distribution, that can be used in the model.
<br>
<br>

Nelson et al (2006, Sec 4.1) consider a survival model with a gamma distributed random effect. They
fit the model using SAS NLMIXED, but face problems when trying to fit the model using 
adaptive Gaussian quadrature,
which is the default in SAS NLMIXED.
The box to the left gives an implementation of the model in ADMB-RE, which has no difficulties in 
fitting the model with adaptive Gaussian quadrature (via the command line option -gh 50).
Hence, it appears that ADMB-RE is numerically more stable than SAS NLMIXED<br><br>
<br>

The following table compares the results from Nelson et al (Table 2, using non-adaptive Gaussian quadrature)
with ADMB-re (50 quadrature points in adaptive Gaussian quadrature). It is seen that 
the results are very similar.

<table cellspacing="10" cellpadding="2" border="0">
<tr>
	<td></td>
	<td>Nelson et al.</td>
	<td>ADMB-RE</td>
</tr>
<tr><td>theta_1  </td><td>  0.2173 </td><td>	0.2173106 </td> </tr>
<tr><td>b0   </td><td>    -2.6154  </td><td>     -2.61536 </td> </tr>
<tr><td>b_trt  </td><td>  -0.8005  </td><td>     -0.800516 </td> </tr>
<tr><td>b_hrt  </td><td>   0.6920  </td><td>      0.691962 </td> </tr>
</table>

<h3><strong>References</strong></h3>

Nelson KP, Lipsitz, Garrett, Fitzmaurice, Ibrahim, Parzen and Strawderman (2006).
Use of the Probability Integral Transformation to Fit Nonlinear Mixed-Effects 
Models With Nonnormal Random Effects. 
Journal of Computational & Graphical Statistics, Vol. 15, No. 1, pp.39-57

</table>

